let bigImgBox = $('.big_imgBox');
let ulList = $('.big_imgBox ul')
let innerLast = $('.inner_last');
let innerNext = $('.inner_next');
let current = 0;
let weiyi = 0;
let flag = true
bigImgBox.css({
    'left': `0px`
})
innerLast.on('click', function () {
    current--
    if (current === -1) {
        current = ulList.length - 1;
        let weiyi = current * 645;
        bigImgBox.css('transition', 'none')
        bigImgBox.css('transform', `translateX(-${weiyi}px)`)

    } else {
        let weiyi = current * 645;
        bigImgBox.css('transition', '1s')
        bigImgBox.css('transform', `translateX(-${weiyi}px)`);
    }
})

innerNext.on('click', function () {
    if (!flag) return
    current++
    let weiyi = current * 645;
    bigImgBox.css('transition', '1s')
    bigImgBox.css('transform', `translateX(-${weiyi}px)`);
    flag = !flag
})
// 动画结束事件
bigImgBox.on('transitionend', function () {
    // 当curent已经是2，让动画结束后，变成真正的第一张
    if (current === ulList.length - 1) {
        current = 0
        bigImgBox.css('transition', '0s')
        bigImgBox.css('transform', 'translateX(0)')
    }
    flag = !flag
    console.log(current);

})